package cn.stylefeng.guns.modular.mapper;

import cn.stylefeng.guns.modular.entity.Schedule;
import cn.stylefeng.guns.modular.entity.Scheduleitem;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import javax.xml.crypto.Data;
import java.util.Collection;
import java.util.Date;
import java.util.Map;

/**
 * @author third_e
 * @create 2019/12/18 0018-下午 4:28
 */
public interface ScheduleMapper extends BaseMapper<Schedule> {

    /**
     * 删除日程
     * @param scheduleId
     */
    void deleteScheduleByID(@Param("scheduleId") Long scheduleId);

    /**
     * 获取日程信息
     * @param scheduleId
     * @return
     */
    Schedule getByscheduleId(@Param("scheduleId") Long scheduleId);

    /**
     * 查询条件
     * @param page
     * @param publicOrprivate
     * @param shareOrnotshare
     * @param sortBydefault
     * @param nameOrcontent
     * @param beginTime
     * @param endTime
     * @param userId
     * @return
     */
    Page<Map<String,Object>> selectSchedule(@Param("page") Page page,
                                            @Param("publicOrprivate") String publicOrprivate,
                                            @Param("shareOrnotshare") String shareOrnotshare,
                                            @Param("sortBydefault") String sortBydefault,
                                            @Param("nameOrcontent") String nameOrcontent,
                                            @Param("beginTime") String beginTime,
                                            @Param("endTime") String endTime,
                                            @Param("userId") Long userId);


    /**
     * 获取一个日程及其全部日程项
     * @param scheduleId
     * @return
     */
    Schedule selectScheduleAnditemByscheduleId(@Param("scheduleId") Long scheduleId,
                                               @Param("userId") Long userId);


    Collection<Schedule> getTodayScheduleMapper(@Param("userId") Long userId,
                                                @Param("scheduleitemDay") String scheduleitemDay);

    Collection<Schedule> getScheduleByframeId(@Param("frameId") Long frameId);


}
